<!-- 导航URL -->
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a href="index.html">主页</a></li>
            <li>超级银行家</li>
            <li class="active"><strong>信用卡银行导入数据管理</strong></li>
        </ol>
    </div>
</div>
<!-- 主要内容 -->
<div class="wrapper wrapper-content animated fadeIn" ng-controller="bankImportCtrl">
    <form class="form-horizontal" id="form1">
        <div class="row">
            <div class="col-lg-12">
                <div class="panel-body ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>查询条件</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">银行编码：</label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" ng-model="baseInfo.bankCode">
                            </div>
                            <label class="col-sm-2 control-label">银行名称：</label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" ng-model="baseInfo.bankName">
                            </div>
                            <label class="col-sm-2 control-label">银行别称：</label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" ng-model="baseInfo.bankNickName">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">导入时间：</label>
                            <div class="col-sm-6">
                                <input id="d5223" class="form-control" type="datetime" ng-model="baseInfo.importTimeStart" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="var d5224=$dp.$('d5224');WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',onpicked:function(){d5224.focus();},maxDate:'#F{$dp.$D(\'d5224\')}'})"/>
                                ~
                                <input id="d5224" class="form-control" type="datetime"  ng-model="baseInfo.importTimeEnd" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d5223\')}'})"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">类型：</label>
                            <div class="col-sm-2">
                                <select class="form-control" ng-model="baseInfo.bonusType" ng-options="x.value as x.text for x in bonusTypeList">
                                </select>
                            </div>
                            <label class="col-sm-2 control-label">状态：</label>
                            <div class="col-sm-2">
                                <select class="form-control" ng-model="baseInfo.status" ng-options="x.value as x.text for x in statusList">
                                </select>
                            </div>
                        </div>

                        <div class="form-group" style="margin-top: 30px">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-8">
                                <button class="btn btn-primary6 btn-mr20"  ng-click="query()" ng-disabled="submitting">查询</button>
                                <button class="btn btn-primary3 btn-mr20" type="button" ng-click="resetForm()">清空</button>
                                <button class="btn btn-new btn-mr20" type="button" ng-click="importModal()"
                                        ng-show="hasPermit('bankImport.importData')">导入</button>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="panel-body ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>查询列表</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="tposition">
                            <div class="gridStyle" ui-grid="infoGrid" ui-grid-selection ui-grid-pagination
                                 ui-grid-resize-columns ui-grid-pinning></div>
                            <div ng-show="loadImg" class="timg"></div>
                        </div>
                    </div>
                </div>
                <div style="height:30px;"></div>
            </div>
        </div>
    </form>

    <div id="importModal" class="modal fade form-horizontal" tabindex="3" role="dialog">
        <div class="modal-dialog" style="height:300px;width: 700px">
            <div class="modal-content" style="width: 700px">
                <form class="form-horizontal" name="horizontalAcc">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">
                            &times;</button>
                        <h3 class="modal-title">信用卡银行数据批量导入</h3>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">信用卡银行：</label>
                            <div class="col-sm-4">
                                <select chosen="{width:'100%'}" id="autocomplete-select1" class="chosen-select" tabindex="2" ng-model="importInfo.id" ng-options="bank.id as bank.bankNickName for bank in banksList">
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">类型：</label>
                            <div class="col-sm-4">
                                <select class="form-control" ng-model="importInfo.bonusType" ng-options="x.value as x.text for x in bonusTypeList">
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">导入文件：</label>
                            <div class="col-sm-4" style="padding-top: 4px">
                                <input type="file" nv-file-select="" ng-model="fileSelect" uploader="uploader" multiple/>
                                <table class="table">
                                    <tbody>
                                    <tr ng-repeat="item in uploader.queue">
                                        <td>
                                            <strong>{{ item.file.name }}</strong>
                                        </td>
                                        <td nowrap>
                                            <button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">
                                                <span class="glyphicon glyphicon-trash"></span>删除
                                            </button>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <label class="col-sm-1" ></label>
                            <div class="col-sm-3 checkbox">
                                <!--<a href="bankImport/importTemplate?bankNickName={{importInfo.bankNickName}}"-->
                                <a
                                 ng-click="downTemplate(importInfo.id,importInfo.bonusType)">导入模板</a>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <div class="form-group control-label">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-6">
                                <button class="btn btn-primary btn-mr20" type="button" ng-click='importInfo()'
                                        ng-disabled="uploader.queue.length == 0 || importStatus"
                                >确定</button>
                                <button class="btn btn-primary4" type="button" ng-click='cancel()'
                                >返回</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
